package ln.fxspringarchetype.mapper;

import ln.fxspringarchetype.model.Score;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface ScoreMapper {
    Score find(@Param("id") int id);

    List<Score> findAll();

    List<Score> findPage(@Param("pageNum") int pageNum, @Param("pageSize") int pageSize);

    int count();

    int pageCount(@Param("pageSize") int pageSize);

    int insert(@Param("score") Score score);

    int insertBatch(@Param("scores") List<Score> scores);

    int delete(@Param("id") int id);

    int deleteBatch(@Param("scores") List<Score> scores);

    int update(@Param("score") Score score);

    int updateBatch(@Param("scores") List<Score> scores);

    List<Score> findPageByStudentName(
            @Param("studentName") String studentName,
            @Param("pageNum") int pageNum,
            @Param("pageSize") int pageSize);

    int pageCountByStudentName(@Param("studentName") String studentName, @Param("pageSize") int pageSize);
}
